#ifndef __DEBUG__H__
#define __DEBUG__H__

#include <errno.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

#define DEBUG_ON		1

#ifndef ERR_DUMP
#if DEBUG_ON
#define ERR_DUMP(__info)		do { \
									fprintf(stderr, "\033[1;31m[%s: \033[32m%d\033[1;31m]\033[0m %s: \033[1;34m%s\033[0m\n", __FILE__, __LINE__, __info, strerror(errno)); \
								} while(0)
#else
#define ERR_DUMP(__info)
#endif
#endif

#ifndef WAR_DUMP
#if DEBUG_ON
#define WAR_DUMP(__info)		do { \
									fprintf(stderr, "\033[1;31mWARNING: \033[0m%s: \033[1;34m%s\033[0m\n", __info, strerror(errno)); \
								} while(0)
#else
#define WAR_DUMP(__info)
#endif
#endif

#ifndef INF_DUMP
#if DEBUG_ON
#define INF_DUMP(__info, ...)		do { \
									fprintf(stderr, "\033[1;32mINFO: \033[0m"__info"\n", ##__VA_ARGS__); \
								} while(0)
#else
#define INF_DUMP(__info, ...)
#endif
#endif

#ifdef __cplusplus
}
#endif

#endif